package com.danbay.cloud.base.constants;


/**
 * 短信类型枚举
 *
 * @author SJG
 *         2018/01/10
 */
public enum SmsType {
    //默认密码
    DEFAULT_PWD(0, "defaultPwd"),
    //重置密码
    RESET_PWD(1, "resetPwd"),
    //普通验证码
    CHECK_CODE(2, "checkCode"),
    //门锁密码
    DOOR_PWD(3, "doorPwd"),
    //找回密码验证码
    FIND_PWD_CHECK_CODE(4, "findPwdCheckCode"),
    //租客临时密码
    TENANT_TEMP_PWD(5, "tenantTempPwd"),
    //租客密码
    TENANT_PWD(6, "tenantPwd"),
    //租客手机号变更通知
    TENANT_MOBILE_CHANGE(7, "tenantMobileChange"),
    //门锁临时密码
    DOOR_TEMP_PWD(8, "doorTempPwd"),
    //员工注册通知
    EMPLOYEE_REG_NOTICE(9,"employeeRegNotice"),
    //绑定账户通知
    BIND_ACCOUNT_NOTICE(10,"bindAccountNotice"),
    //账号变更通知
    ACCOUNT_CHANGE_NOTICE(11,"accountChangeNotice"),
    //注册通知
    REGISTER_NOTICE(12,"registerNotice"),
    NONE(-1, "错误");

    private final int value;
    private final String phrase;

    SmsType(int value, String phrase) {
        this.value = value;
        this.phrase = phrase;
    }

    public int value() {
        return value;
    }

    public String getPhrase() {
        return phrase;
    }

    public static String getPhrase(int value) {
        for (SmsType t : values()) {
            if (t.value == value) {
                return t.phrase;
            }
        }
        return "错误类型";
    }
}